package com.passion.utils;

import java.util.Collection;
import java.util.Map;
import java.util.UUID;
import java.util.function.BiConsumer;

/**
 * @program offline-e-commerce-data-warehouse
 * @Description
 * @Author limeihua
 * @Date 2024/10/10 20:32
 * @Version 1.0
 */
public class UUIDUtils {
    private UUIDUtils() {

    }

    public static String getSimple() {
        return UUID.randomUUID().toString();
    }

    public static String generateUUID(Map<String, String> map) {
        StringBuilder result = new StringBuilder();
        Collection<String> values = map.values();
        for (String value : values) {
            String replaceAll = value.replaceAll("-", "");
            result.append(replaceAll).append("-");
        }
        int length = result.length();
        if (length > 0) {
            result.deleteCharAt(length - 1);
        }
        return result.toString();
    }

}
